package common

import (
	"mpps/tools/registry"

	"github.com/asim/go-micro/v3/client"
	"github.com/asim/go-micro/v3/transport"
)

func init() {
	register := registry.GetRegistry()
	client.DefaultClient.Init(
		client.Registry(register),
		client.Transport(
			transport.NewHTTPTransport(transport.Secure(true)),
		),
	)
}

func GetMicroClient() client.Client {
	// // register := GetRegistry(
	// // 	RegistryFun(Etcd),
	// // )
	// register := GetRegistry()
	// // create service
	// service := micro.NewService(
	// 	micro.Registry(register),
	// )
	// service.Init()
	// return service.Client()
	return client.DefaultClient
}
